<script setup>

   import {onMounted,onUpdated , ref} from 'vue'

    /**
     * 回调钩子: 8个
     * 回调作用: 类似初始化和销毁方法,页面数据初始化的!
     * 回调函数: beforeCreate , created , beforeMount ,  mounted (页面初始化数据访问) , beforeUpdate , updated , beforeUnMount , unMounted
     * 钩子使用:
     */
    
    onMounted(()=>{
        console.log("----onMounted------");
    }) 

    onUpdated(()=>{
        console.log("----onUpdated------");
    }) 

    let counter = ref(0);

</script>

<template>
  <div>
        {{counter}} <button @click="counter++">+</button>
  </div>
</template>

<style scoped>

</style>